#!/bin/bash
cd src
# 清除旧的编译文件
rm -rf ../packer/dist
mkdir -p ../packer/dist
# 根据参数判断编译平台：w、l、la、m
if [ "$1" == "w" ]; then
    GOOS=windows GOARCH=amd64 go build -o ../packer/dist/start.exe
elif [ "$1" == "l" ]; then
    GOOS=linux GOARCH=amd64 go build -o ../packer/dist/start.exe
    bash ../bash/build_linux_after.sh
elif [ "$1" == "la" ]; then
    GOOS=linux GOARCH=arm64 go build -o ../packer/dist/start.exe
    bash ../bash/build_linux_after.sh
elif [ "$1" == "m" ]; then
    GOOS=darwin GOARCH=amd64 go build -o ../packer/dist/start.exe
else
    echo "Usage: $0 {w|l|la|m}"
    echo "w: Windows 64-bit"
    echo "l: Linux 64-bit"
    echo "la: Linux ARM 64-bit"
    echo "m: macOS 64-bit"
    echo "Example: $0 w"
    echo "Example: $0 l"
    echo "Example: $0 la"
    echo "Example: $0 m"
    exit 1
fi


